function add(x,y){
    return x+y;
}
function sub(x,y){
    return x-y;
}
function cheng(x,y){
    return x*y;
}
function chu(x,y){
    return x/y;
}
console.log(add(3,4));
console.log(sub(3,4));
console.log(cheng(3,4));
console.log(chu(3,4));
//函数的参数
//无参函数
function print01(){
     console.log("hello 计算机2221");
}
print01();
//有参函数
function print02(str){
     console.log("hello 计算机2221");
}
print02("hello 计算机2221");
//可变长度参数，...代表可变长度
function add2(x,...y){
    var sum=x;
    for(e of y){
        sum+=e;
    }
    return sum;
}
console.log(add2(3));
console.log(add2(3,4));
console.log(add2(3,4,5));
console.log(add2(3,4,5,6,7,8,9));
